<div id="keyCustomerManagement">
  <link rel="stylesheet" type="text/css" href="pages/example/custCenter/customerFilling.css"/>
  <yu-panel title="重点客户">
    <yu-xform ref="customerInfoSearch" related-table-name="khtable" form-type="search"
              :custom-search-fn="searchFn">
      <yu-xform-group :column="3">
        <yu-xform-item label="客户名称" placeholder="客户名称" name="custName"
                       ctype="input"></yu-xform-item>
          <yu-xform-item label="证件号码" placeholder="证件号码" name="ctfNo"
                         ctype="input"></yu-xform-item>
        <yu-xform-item v-if="judgeUser" @change="changeCustOrgId" label="归属机构" placeholder="归属机构" :options="options1" ctype="select"
                       name="custOrgId"></yu-xform-item>
        <yu-xform-item label="归属网格" placeholder="归属网格" :options="options2" ctype="select"
                       name="custGridId"></yu-xform-item>
      </yu-xform-group>
    </yu-xform>
    <div style="justify-content:space-between;display: flex">
      <div>
        <yu-button type="warning" @click="lookupInformation()" >查询基本信息</yu-button>
      </div>
    </div>
    <div style="height: 30px"></div>
    <yu-xtable ref="khtable" :base-params="custData" :data-url="funcDataUrl" request-type="get" row-number style="width: 100%" selection-type="checkbox">
<!--      <yu-xtable-column prop="custNo" label="客户编号" width="90px" align="center" show-overflow-tooltip></yu-xtable-column>-->
      <yu-xtable-column prop="custName" label="客户名称"  align="center" show-overflow-tooltip>
		  <div slot-scope="scope" style="cursor: pointer"  @click="toCustView(scope.row)">
		      <div style="color: #0835ff;">{{scope.row.custName}}</div>
		  </div>
	  </yu-xtable-column>
      <yu-xtable-column prop="gridName" label="归属机构"  align="center" show-overflow-tooltip></yu-xtable-column>
      <yu-xtable-column prop="custLevel" label="客户等级"  data-code="CUST_LEVEL"  align="center" show-overflow-tooltip></yu-xtable-column>
      <yu-xtable-column prop="ctfTp" label="证件类型"  align="center" data-code="CARD_TYPE" show-overflow-tooltip></yu-xtable-column>
      <yu-xtable-column prop="ctfNo" label="证件号码"  align="center"  width="170px"  show-overflow-tooltip>
          <template slot-scope="scope">
              {{scope.row.ctfNo? scope.row.ctfNo.replace(/^(.{14})(?:\w+)(.{0})$/,
              "\$1****\$2"):""}}
          </template>
      </yu-xtable-column>
      <yu-xtable-column prop="mobNo" label="联系电话"  align="center" show-overflow-tooltip>
          <template slot-scope="scope">
              {{scope.row.mobNo? scope.row.mobNo.replace(/^(.{7})(?:\w+)(.{0})$/,
              "\$1****\$2"):""}}
          </template>
      </yu-xtable-column>
      <yu-xtable-column prop="address" label="联系地址"  align="center" show-overflow-tooltip></yu-xtable-column>
      <yu-xtable-column prop="isSun" label="阳光信贷"  align="center">
          <template slot-scope="scope">
            <div v-if="scope.row.isSun == '1'" style="color: red;">是</div>
            <div v-if="scope.row.isSun == '0'" style="color: black;">否</div>
          </template>
      </yu-xtable-column>
      <yu-xtable-column prop="isImport" label="重点客户" align="center" >
        <div slot-scope="scope" style="cursor: pointer" @click="updateImport(scope.row.isImport,scope.row.custNo)">
          <img v-if="scope.row.isImport == '1'" src="themes/common/images/isImport.png" width="18px" height="18px" />
          <img v-else="scope.row.isImport == '0'" src="themes/common/images/unImport.png" width="18px" height="18px" />
        </div>
      </yu-xtable-column>
    </yu-xtable>
  </yu-panel>
  <!-- 新增客户弹框-->
  <el-dialog :center="true" title="客户信息" :visible.sync="dialogFormVisible" position="relative" >
    <div style="display: flex;height: auto;position: relative;transition: all .5s;flex-direction: column">
      <yu-xform :disabled="formDisabled" ref="custForm"  label-width="110px"  v-model="custInfo">
        <yu-xform-group :column="2">
          <yu-xform-item label="客户名称" placeholder="客户名称"  name="custName" ctype="input"></yu-xform-item>
          <yu-xform-item label="证件类型" placeholder="请选择"  name="ctfTp" ctype="select" data-code="CARD_TYPE"></yu-xform-item>
        </yu-xform-group>
        <yu-xform-group :column="2">
          <yu-xform-item label="证件号码" placeholder="证件号码"  name="ctfNo" ctype="input"></yu-xform-item>
          <yu-xform-item label="性别" placeholder="请选择" name="gndrCd" ctype="select" data-code="SEX_TYPE"></yu-xform-item>
        </yu-xform-group>
        <yu-xform-group :column="2">
          <yu-xform-item label="职业" placeholder="请选择" name="ocpCd" ctype="select" data-code="OCP_CD"></yu-xform-item>
          <yu-xform-item label="手机号码" placeholder="手机号码" name="mobNo" ctype="input"></yu-xform-item>
        </yu-xform-group>
        <yu-xform-group :column="1">
          <yu-xform-item label="联系地址" placeholder="联系地址" name="address" ctype="input"></yu-xform-item>
        </yu-xform-group>
        <yu-xform-group :column="1">
          <yu-xform-item label="行业" placeholder="请选择" name="entpIdyCgy" data-code="BLG_IDY" ctype="select"></yu-xform-item>
        </yu-xform-group>
        <yu-xform-group :column="2">
          <yu-xform-item label="场景类型" placeholder="场景类型" ctype="select"
                         name="sceneType" data-code="SCENE_TYPE"></yu-xform-item>
          <yu-xform-item label="栋/组" placeholder="请输入内容" :unit="custInfo.sceneType == 1 ? '组': custInfo.sceneType === '0' ? '栋' :''"
                         ctype="input" name="witchTypeValue"></yu-xform-item>
        </yu-xform-group>
      </yu-xform>
      <div slot="footer" class="dialog-footer" align="center">
        <el-button v-if="saveBtnShow" type="primary" @click="saveEditFunc()">保存</el-button>
        <el-button v-if="saveBtnShow" @click="restInputValue()">取消</el-button>
      </div>
    </div>
  </el-dialog>
</div>
